package cn.zjyj.module.zjyj.dal.mysql.deviceinstanceacceptancerecord;

import cn.zjyj.framework.common.common.pojo.PageResult;
import cn.zjyj.framework.datasource.mybatis.core.query.LambdaQueryWrapperX;
import cn.zjyj.framework.datasource.mybatis.core.mapper.BaseMapperX;
import cn.zjyj.module.zjyj.dal.dataobject.deviceinstanceacceptancerecord.DeviceInstanceAcceptanceRecordDO;
import org.apache.ibatis.annotations.Mapper;
import cn.zjyj.module.zjyj.controller.admin.deviceinstanceacceptancerecord.vo.*;

/**
 * 设备实例验收单 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface DeviceInstanceAcceptanceRecordMapper extends BaseMapperX<DeviceInstanceAcceptanceRecordDO> {

    default PageResult<DeviceInstanceAcceptanceRecordDO> selectPage(DeviceInstanceAcceptanceRecordPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DeviceInstanceAcceptanceRecordDO>()
                .betweenIfPresent(DeviceInstanceAcceptanceRecordDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(DeviceInstanceAcceptanceRecordDO::getDeviceId, reqVO.getDeviceId())
                .eqIfPresent(DeviceInstanceAcceptanceRecordDO::getInstanceId, reqVO.getInstanceId())
                .betweenIfPresent(DeviceInstanceAcceptanceRecordDO::getAcceptanceDate, reqVO.getAcceptanceDate())
                .eqIfPresent(DeviceInstanceAcceptanceRecordDO::getAcceptancePersonId, reqVO.getAcceptancePersonId())
                .eqIfPresent(DeviceInstanceAcceptanceRecordDO::getAcceptanceResult, reqVO.getAcceptanceResult())
                .eqIfPresent(DeviceInstanceAcceptanceRecordDO::getAcceptanceRemark, reqVO.getAcceptanceRemark())
                .orderByDesc(DeviceInstanceAcceptanceRecordDO::getId));
    }

}